import UnityEngine

class TP_Controller (MonoBehaviour): 
	public static characterController as CharacterController
	public static instance as TP_Controller

	def Awake ():
		characterController = GetComponent("CharacterController") as CharacterController
		instance = self;
	
	def Update ():
		if(Camera.mainCamera == null):
			return;
			
		GetLocomotionInput()
		
		TP_Motor.instance.UpdateMotor()
		
	def GetLocomotionInput():
		deadZone = 0.1
		TP_Motor.instance.moveVector = Vector3.zero
		
		if(Input.GetAxis("Vertical")>deadZone or Input.GetAxis("Vertical")<-deadZone):
			TP_Motor.instance.moveVector += Vector3(0,0,Input.GetAxis("Vertical"))
			
		if(Input.GetAxis("Horizontal")>deadZone or Input.GetAxis("Horizontal")<-deadZone):
			TP_Motor.instance.moveVector += Vector3(Input.GetAxis("Horizontal"),0,0)
		
